from appium import webdriver
from time import sleep
from selenium.webdriver.common.by import By
import os
class GouWuChe():
    def gg(self):
        os.system("adb root")
        cap = {
            "platformName": "Android",
            "deviceName": "emulator-5554",
            "noReset": True,
            "appPackages": "com.kongfz.app",
            "appActivity": "com.kongfz.app.mvvm.home.homepage.HomeActivity",
        }
        self.driver=webdriver.Remote("http://127.0.0.1:4723/wd/hub",cap)
        self.driver.implicitly_wait(25)
        sleep(15)
    def wu(self):
        self.driver.find_element(By.ID,"com.kongfz.app:id/tv_plus")
        sleep(2)
        self.driver.find_element(By.XPATH,"/hierarchy/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.FrameLayout/android.widget.RelativeLayout/android.widget.FrameLayout/android.widget.FrameLayout[2]/android.view.ViewGroup/android.view.ViewGroup[1]/android.widget.LinearLayout/android.view.ViewGroup[2]/android.widget.TextView[3]")
        sleep(2)
        self.driver.find_element(By.ID,"com.kongfz.app:id/tv_address")
        sleep(2)
        self.driver.find_element("class","android.widget.TextView")
        sleep(3)
        self.driver.find_element("text","配送至：昌平区南大街21号")
        sleep(3)